package com.forum.module.system.dal.mysql.role;

import com.forum.framework.common.pojo.PageResult;
import com.forum.framework.mybatis.core.mapper.BaseMapperX;
import com.forum.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.forum.module.system.controller.admin.role.vo.RolePageReqVO;
import com.forum.module.system.dal.dataobject.role.RoleDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 功能:
 * 作者:ouyzh
 * 日期:2025/3/15 20:44
 */
@Mapper
public interface RoleMapper extends BaseMapperX<RoleDO> {
    default PageResult<RoleDO> selectPage(RolePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RoleDO>()
                .eqIfPresent(RoleDO::getName, reqVO.getName())
                .betweenIfPresent(RoleDO::getCreateTime, reqVO.getCreateTime()));
    }
}
